---
layout: m1x_soap
title: Add Comment
---

<h3><a name="order_creditmemo.addComment-Module%3AOrderCreditMemoAPI"></a>Module: Order Credit Memo API</h3>

<h4><a name="order_creditmemo.addComment-Resource%3Asalesordercreditmemo"></a>Resource: sales_order_creditmemo</h4>

<p><b>Aliases</b>: order_creditmemo</p>

<h5><a name="order_creditmemo.addComment-Method%3A"></a>Method:</h5>

<ul>
	<li>order_creditmemo.addComment (SOAP V1)</li>
	<li>salesOrderCreditmemoAddComment (SOAP V2)</li>
</ul>


<p>Allows you to add a new comment to an existing credit memo. Email notification can be sent to the user email.</p>

<p><b>Arguments:</b></p>

<table><tbody>
<tr>
<th> Type </th>
<th> Name </th>
<th> Description </th>
</tr>
<tr>
<td> string </td>
<td> sessionId <br class="atl-forced-newline" /> </td>
<td> Session ID </td>
</tr>
<tr>
<td> string </td>
<td> creditmemoIncrementId </td>
<td> Credit memo increment ID </td>
</tr>
<tr>
<td> string </td>
<td> comment </td>
<td> Comment text (optional) </td>
</tr>
<tr>
<td> int </td>
<td> notifyCustomer </td>
<td> Notify customer by email flag (optional) </td>
</tr>
<tr>
<td> int </td>
<td> includeComment </td>
<td> Include comment text into the email notification (optional) </td>
</tr>
</tbody></table>


<p><b>Return:</b></p>

<table><tbody>
<tr>
<th> Type </th>
<th> Description </th>
</tr>
<tr>
<td> boolean\int </td>
<td> True (1) if the comment is added to the credit memo </td>
</tr>
</tbody></table>


<p><b>Faults:</b></p>


<table><tbody>
<tr>
<th> Fault Code </th>
<th> Fault Message </th>
</tr>
<tr>
<td> 100 </td>
<td> Requested credit memo does not exist. </td>
</tr>
<tr>
<td> 102 </td>
<td> Invalid data given. Details in error message. </td>
</tr>
</tbody></table>


<h4><a name="order_creditmemo.addComment-Examples"></a>Examples</h4>

<h5><a name="order_creditmemo.addComment-RequestExampleSOAPV1"></a>Request Example SOAP V1</h5>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div>
		<pre class="theme: Default; brush: php; gutter: false">$proxy = new SoapClient('http://magentohost/api/soap/?wsdl');
$sessionId = $proxy-&gt;login('apiUser', 'apiKey');
$creditmemoIncrementId = '200000001'; //increment id of existing credit memo
$commentText = "Credit memo comment successfully added";

$isCommentAdded = $proxy-&gt;call($sessionId, 'order_creditmemo.addComment', array($creditmemoIncrementId, $commentText, true));</pre>
		</div>
</div></div>

<h5><a name="order_creditmemo.addComment-RequestExampleSOAPV2"></a>Request Example SOAP V2</h5>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div>
		<pre class="theme: Default; brush: php; gutter: false">$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl'); // TODO : change url
$sessionId = $proxy-&gt;login('apiUser', 'apiKey'); // TODO : change login and pwd if necessary

$result = $proxy-&gt;salesOrderCreditmemoAddComment($sessionId, '200000001');
var_dump($result);</pre>
		</div>
</div></div>

<h5><a name="order_creditmemo.addComment-RequestExampleSOAPV2%28WSIComplianceMode%29"></a>Request Example SOAP V2 (WS-I Compliance Mode)</h5>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div>
		<pre class="theme: Default; brush: php; gutter: false">$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl'); 

$sessionId = $proxy-&gt;login((object)array('username' =&gt; 'apiUser', 'apiKey' =&gt; 'apiKey')); 
 
$result = $proxy-&gt;salesOrderCreditmemoAddComment((object)array('sessionId' =&gt; $sessionId-&gt;result, 'creditmemoIncrementId' =&gt; '200000001', 'comment' =&gt; 'credit memo comment', 'notifyCustomer' =&gt; 1, 'includeComment' =&gt; 1));   
var_dump($result-&gt;result);</pre>
		</div>
</div></div>


